package com.cykj.shop.domain.dto;

import javax.validation.constraints.DecimalMin;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;

/**
 * 配送费规则DTO
 * 
 * @author cykj
 * @date 2025-01-20
 */
public class DeliveryFeeRuleDto {
    
    /** 规则ID（更新时需要） */
    private Long id;
    
    /** 规则名称 */
    @NotBlank(message = "规则名称不能为空")
    private String ruleId;
    
    /** 商家ID */
    @NotNull(message = "商家ID不能为空")
    private Long shopId;
    
    /** 基础配送距离(公里) */
    @NotNull(message = "基础配送距离不能为空")
    @DecimalMin(value = "0.01", message = "基础配送距离必须大于0")
    private BigDecimal baseDistance;
    
    /** 基础配送费(元) */
    @NotNull(message = "基础配送费不能为空")
    @DecimalMin(value = "0.00", message = "基础配送费不能小于0")
    private BigDecimal baseFee;
    
    /** 超出后的计费单位距离(公里) */
    @NotNull(message = "计费单位距离不能为空")
    @DecimalMin(value = "0.01", message = "计费单位距离必须大于0")
    private BigDecimal extraUnitDistance;
    
    /** 每单位额外费用(元) */
    @NotNull(message = "每单位额外费用不能为空")
    @DecimalMin(value = "0.00", message = "每单位额外费用不能小于0")
    private BigDecimal extraUnitFee;
    
    /** 最大可配送距离(为空表示不限制) */
    private BigDecimal maxDistance;
    
    /** 启用状态(0:禁用,1:启用) */
    private Integer isActive;

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRuleId() {
        return ruleId;
    }

    public void setRuleId(String ruleId) {
        this.ruleId = ruleId;
    }

    public Long getShopId() {
        return shopId;
    }

    public void setShopId(Long shopId) {
        this.shopId = shopId;
    }

    public BigDecimal getBaseDistance() {
        return baseDistance;
    }

    public void setBaseDistance(BigDecimal baseDistance) {
        this.baseDistance = baseDistance;
    }

    public BigDecimal getBaseFee() {
        return baseFee;
    }

    public void setBaseFee(BigDecimal baseFee) {
        this.baseFee = baseFee;
    }

    public BigDecimal getExtraUnitDistance() {
        return extraUnitDistance;
    }

    public void setExtraUnitDistance(BigDecimal extraUnitDistance) {
        this.extraUnitDistance = extraUnitDistance;
    }

    public BigDecimal getExtraUnitFee() {
        return extraUnitFee;
    }

    public void setExtraUnitFee(BigDecimal extraUnitFee) {
        this.extraUnitFee = extraUnitFee;
    }

    public BigDecimal getMaxDistance() {
        return maxDistance;
    }

    public void setMaxDistance(BigDecimal maxDistance) {
        this.maxDistance = maxDistance;
    }

    public Integer getIsActive() {
        return isActive;
    }

    public void setIsActive(Integer isActive) {
        this.isActive = isActive;
    }

    @Override
    public String toString() {
        return "DeliveryFeeRuleDto{" +
                "id=" + id +
                ", ruleId='" + ruleId + '\'' +
                ", shopId=" + shopId +
                ", baseDistance=" + baseDistance +
                ", baseFee=" + baseFee +
                ", extraUnitDistance=" + extraUnitDistance +
                ", extraUnitFee=" + extraUnitFee +
                ", maxDistance=" + maxDistance +
                ", isActive=" + isActive +
                '}';
    }
}
